package com.yuba.front.service.impl;

import com.yuba.common.core.domain.event.OssUploadEvent;
import com.yuba.common.core.utils.SpringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

@Service
@RequiredArgsConstructor
public class FrontOssService {

    public OssUploadEvent upload(MultipartFile avatarfile) {
        OssUploadEvent event = OssUploadEvent.builder()
            .file(avatarfile)
            .build();

        SpringUtils.context().publishEvent(event);
        return event;
    }
}
